class Solution:
    def sortedSquares(self, nums: List[int]) -> List[int]:
        a=len(nums)
        l=0
        r=a-1
        while l<=r:
            if abs(nums[l])>abs(nums[r]):
                nums[a-1]=num[l]**2
                l-=1
            else:
                nums[a-1]=nums[r]**2
                r-=1
            return nums